﻿Imports Telerik.Windows.Controls
Imports Telerik.Windows.Data
Imports Global_Visas_Business_Layer
Imports System.Data
Imports System.Text
Partial Public Class frmAdminEventTypes


    Private Sub frmAdminEventTypes_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
        GeneralTasks.ChangeTheme(Me)
        GeneralTasks.EnumerateandFill(Me.LogicalChildren)
        refreshList()
        Me.btnAddToGroup.IsEnabled = False
        Me.btnRemoveFromGroup.IsEnabled = False
        Me.btnMoveDown.Visibility = Windows.Visibility.Hidden
        Me.btnMoveUp.Visibility = Windows.Visibility.Hidden
        'Me.btnStages.Visibility = Windows.Visibility.Hidden
        Me.btnResticted.Visibility = Windows.Visibility.Hidden
    End Sub

    Private Sub refreshList()
        Me.grdEventTypes.ItemsSource = Admin.EventTypesList
        Me.grdEventTypes.Columns(0).IsVisible = False
        Me.grdEventTypes.Columns(1).Width = New GridLength(150)
        Me.grdEventTypes.Columns(2).Width = New GridLength(80)
        'Me.grdEventTypes.Columns(4).IsVisible = False

        Me.grdEventGroups.ItemsSource = Admin.EventGroupsList
        Me.grdEventGroups.Columns(0).IsVisible = False
        Me.grdEventGroups.Columns(1).Width = New GridLength(120)
        'Me.grdWhereHear.Columns(1).Width = New GridLength(140)
        'Me.grdQualifications.Columns(3).IsVisible = False
    End Sub

    Private Sub grdEventGroups_SelectionChanged(ByVal sender As Object, ByVal e As Telerik.Windows.Controls.SelectionChangeEventArgs) Handles grdEventGroups.SelectionChanged
        ' Fill the respective charges in the group grdChargesInGroup
        grdEventsInGroup.ItemsSource = Nothing
        Dim selectedRow As DataRow = grdEventGroups.SelectedItem
        If Not selectedRow Is Nothing Then
            FillEventTypesOfGroup(selectedRow(0))
            Me.btnAddToGroup.IsEnabled = True
            Me.btnDelete.IsEnabled = True
            Me.btnEdit.IsEnabled = True
            Me.btnRemoveFromGroup.IsEnabled = True
        Else
            MsgBox("Please select a Charge Group !")
        End If
    End Sub
    Private Sub FillEventTypesOfGroup(ByVal EventGroupId As Integer)
        If EventGroupId = 0 Then
            grdEventsInGroup.ItemsSource = Nothing
            Exit Sub
        End If
        grdEventsInGroup.ItemsSource = Nothing
        grdEventsInGroup.ItemsSource = Admin.EventsInGroupList(EventGroupId)
        grdEventsInGroup.Columns(0).IsVisible = False
        'grdEventsInGroup.Columns(1).IsVisible = False
        grdEventsInGroup.Columns(1).Width = New GridLength(170)
    End Sub

    Private Sub btnAddNew_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnAddNew.Click
        Dim StrSQL As String = String.Empty, GID As Long = Nothing, StrGroup As String, outPut As Boolean
        StrGroup = InputBox("New Event Group", "Add New")
        If StrGroup = String.Empty Then Exit Sub
        Dim tableEventGroups As DataTable = CType(grdEventGroups.ItemsSource, DataTable)
        For Each currentRow As DataRow In tableEventGroups.Rows
            If currentRow(1).ToString().ToUpper().Trim = StrGroup.Trim.ToUpper Then
                MsgBox("The Group already exists . Please enter another.")
                Exit Sub
            End If
        Next
        StrSQL = "Insert Into I_Eventgroups (Eventgroup_Name) VALUES('" & StrGroup & "')"
        outPut = CommonDataFunctions.ExecuteSQL(StrSQL)
        If outPut = True Then
            refreshList()
            MsgBox("New Group Added Successfully !")
            Exit Sub
        Else
            MsgBox("New Groups couldnot be added. Please try again or contact IT .")
        End If


    End Sub

 
    Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnDelete.Click
        Dim StrSQL As String, Result As DataTable, GID As Long
        Dim StrMess As New StringBuilder
        If grdEventGroups.SelectedItems.Count = 0 Then
            MsgBox("Select an EventGroup to delete .")
            Exit Sub
        End If
        Dim selectedRow As DataRow = grdEventGroups.SelectedItem
        GID = selectedRow(0)
        StrSQL = "Select EventGroup_System from I_EventGroups where eventgroup_ID = " & GID
        Result = CommonDataFunctions.GetSQLDatatable(StrSQL)
        If Result.Rows.Count = 0 Then
            'Error
            Result.Dispose()
            Call MsgBox("Eventgroup not found")
            Exit Sub
        End If
        If Result(0)("EventGroup_system") = 1 Then
            Result.Dispose()
            Call MsgBox("The '" & selectedRow(1) & "' group is a protected system group and cannot be removed", , "Error")
            Exit Sub
        End If

        StrMess.Append(String.Empty)

        StrSQL = "Select Product_Name from L_Products where Product_EventGroupID = " & GID
        Result = CommonDataFunctions.GetSQLDatatable(StrSQL)

        If Result.Rows.Count > 0 Then

            StrMess.Append("Products:" & vbCrLf & vbCrLf)
            For Each currentRow As DataRow In Result.Rows
                StrMess.Append(currentRow("Product_Name") & vbCrLf)
            Next
        End If

        Result.Dispose()

        StrSQL = "Select Producttype_Name from L_Producttypes where Producttype_EventGroupID = " & GID
        Result = CommonDataFunctions.GetSQLDatatable(StrSQL)

        If Result.Rows.Count > 0 Then

            If StrMess.ToString() <> String.Empty Then StrMess.Append(vbCrLf)

            StrMess.Append("Product Types:" & vbCrLf & vbCrLf)
            For Each currentRow As DataRow In Result.Rows
                StrMess.Append(currentRow("Producttype_Name") & vbCrLf)
            Next
           
        End If

        Result.Dispose()

        If StrMess.ToString() <> String.Empty Then
            Dim showString As String
            showString = "This Event Type groups is in use, the following records need to be set to a different group before it can be removed" & vbCrLf & vbCrLf & StrMess.ToString()
            Call MsgBox(showString, , "Action Cancelled")
            Exit Sub
        End If

        If MsgBox("Are you sure you want to delete this group?" & vbCrLf & vbCrLf & selectedRow(1), vbYesNo, "Confirm Delete") <> 6 Then Exit Sub


        StrMess.Append("Event Group no. " & GID & " (" & selectedRow(1) & ") deleted")

        StrSQL = "Delete from I_EventLinks where EventLink_EventGroupId = " & GID
        If CommonDataFunctions.ExecuteSQL(StrSQL) = False Then
            MsgBox("couldnot be deleted. Please try again or contact IT .")
            Exit Sub
        End If


        StrSQL = "Delete from I_EventGroups where EventGroup_ID = " & GID
        If CommonDataFunctions.ExecuteSQL(StrSQL) = False Then
            MsgBox("couldnot be added. Please try again or contact IT .")
            Exit Sub
        Else
            refreshList()
            FillEventTypesOfGroup(0)
            MsgBox("Event Group no. " & GID & " (" & selectedRow(1) & ") deleted with success.")
        End If

    End Sub

    Private Sub btnNewEventType_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnNewEventType.Click
        'Dim StrModule As String, Ret As Object

        Dim StrSQL As String, Result As DataTable, StrMess As String, StrType As String, IntScope As Integer
        'Dim  ETID As Long
        Dim Dtype As Integer

        StrType = InputBox("New Event Type", "Add New")

        If StrType = String.Empty Then Exit Sub

        StrSQL = "Select EventType_ID from L_EventTypes Where EventType_Name = '" & StrType.Trim & "'"
        Result = CommonDataFunctions.GetSQLDatatable(StrSQL)

        If Result.Rows.Count > 0 Then
            Result.Dispose()
            Call MsgBox("That Event Type already exists", , "Action Cancelled")
            Exit Sub
        End If
        Result.Dispose()

        If MsgBox("Is this event type specific to a particular user type? (Sales/Casework)", vbYesNo, "Add New") = 6 Then
            If MsgBox("Is this a casework event type?", vbYesNo, "Add New") = 6 Then
                IntScope = 2
                StrMess = "Set for Casework"
            Else
                IntScope = 1
                StrMess = "Set for Sales"
            End If

        Else
            IntScope = 3
            StrMess = "Set for all users"
        End If

        StrMess = StrMess & vbCrLf

        If MsgBox("Is this event type only applicable to a particular customer type? (Corporate/Private)", vbYesNo, "Add to Group") = 6 Then
            If MsgBox("Is this a corporate event type?", vbYesNo, "Add to Group") = 6 Then
                Dtype = 2
                StrMess = StrMess & "Set to corporate clients only"
            Else
                Dtype = 1
                StrMess = StrMess & "Set to private clients only"
            End If
        Else
            Dtype = 0
            StrMess = StrMess & "Set for all clients"
        End If

        StrSQL = "Insert Into L_EventTypes (EventType_Name, EventType_Scope, EventType_CustomerType)"
        StrSQL = StrSQL & " VALUES('" & StrType & "'," & IntScope & ", " & Dtype & ")"

        If CommonDataFunctions.ExecuteSQL(StrSQL) = False Then
            MsgBox("There is an error while adding the Event Type into the system. Please try again or contact IT", MsgBoxStyle.Critical, "Unsuccessful")
            Exit Sub
        Else
            MsgBox("New Event Type added successfully.")
        End If
        refreshList()
        Exit Sub

    End Sub

    Private Sub btnDeleteEventType_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnDeleteEventType.Click
        If grdEventTypes.SelectedItems.Count = 0 Then
            MsgBox("Select the Event Type to delete.")
            Exit Sub
        End If
        Dim deleteOption As MsgBoxResult, selectedRow As DataRow = grdEventTypes.SelectedItem
        deleteOption = MsgBox("Are you really sure to delete This Event Type ?" & selectedRow(1).ToString(), MsgBoxStyle.OkCancel)
        If deleteOption = MsgBoxResult.Ok Then

            Dim StrSQL As String, Result As DataTable, StrMess As String, ETID As Long

            ETID = selectedRow(0)

            StrMess = "Event Type no. " & ETID & " (" & selectedRow(1).ToString() & ") deleted and all Event Links removed"

            StrSQL = "Select EventLink_EventGroupID, EventLink_Order from I_EventLinks "
            StrSQL = StrSQL & " Where EventLink_EventTypeID = " & ETID

            Result = CommonDataFunctions.GetSQLDatatable(StrSQL)

            If Result.Rows.Count > 0 Then
                'Need to go through the EventLink, removing references and shuffling up the other links order values to keep them consistent
                For Each currentRow As DataRow In Result.Rows
                    StrSQL = "Update I_EventLinks Set EventLink_Order = EventLink_Order -1 "
                    StrSQL = StrSQL & " WHERE EventLink_EventGroupId = " & currentRow("EventLink_EventGroupID")
                    StrSQL = StrSQL & " AND EventLink_Order > " & currentRow("EventLink_Order")

                    If CommonDataFunctions.ExecuteSQL(StrSQL) = False Then
                        Result.Dispose()
                        Exit Sub
                    End If

                Next

                Result.Dispose()

                StrSQL = "Delete from I_EventLinks Where EventLink_EventTypeID = " & ETID
                If CommonDataFunctions.ExecuteSQL(StrSQL) = False Then
                    Exit Sub
                End If
            Else
                Result.Dispose()
            End If

            StrSQL = "Delete from L_EventTypes where EventType_ID = " & selectedRow(0)
            If CommonDataFunctions.ExecuteSQL(StrSQL) = True Then
                MsgBox("Event type " & selectedRow(1) & " deleted with success.")

            Else

                MsgBox("There is an error while deleting the Event Type from the system. Please try again or contact IT", MsgBoxStyle.Critical, "Unsuccessful")
                Exit Sub
            End If

            refreshList()
            Exit Sub
            MsgBox("The Charge Group have been deleted successfully.", MsgBoxStyle.Information, "Success")
        ElseIf deleteOption = MsgBoxResult.Cancel Then
            Exit Sub
        End If

    End Sub

    Private Sub btnEditEventType_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnEditEventType.Click
       

        Dim StrSQL As String, Result As DataTable, StrMess As String, StrType As String
        If grdEventTypes.SelectedItems.Count = 0 Then
            MsgBox("PLease select the Event Type to edit.")
            Exit Sub
        End If
        Dim selectedRow As DataRow = grdEventTypes.SelectedItem

        StrType = InputBox("Change Event Type", "Edit", selectedRow(1))

        If StrType = String.Empty Then Exit Sub

        StrSQL = "Select EventType_ID from L_EventTypes Where EventType_Name = '" & StrType & "'"
        StrSQL = StrSQL & " ANd EventType_ID <> " & selectedRow(0)
        Result = CommonDataFunctions.GetSQLDatatable(StrSQL)

        If Result.Rows.Count > 0 Then
            Result.Dispose()
            Call MsgBox("That Event Type already exists", , "Action Cancelled")
            Exit Sub
        End If
        Result.Dispose()

        StrMess = "Event Type no. " & selectedRow(0) & " (" & selectedRow(1) & ") edited, changed to: " & StrType

        StrSQL = "Update L_EventTypes set EventType_Name = '" & StrType.Trim & "'"
        StrSQL = StrSQL & " WHERE EventType_ID = " & selectedRow(0)

        If CommonDataFunctions.ExecuteSQL(StrSQL) = True Then
            refreshList()
            MsgBox(StrMess)
        Else
            MsgBox("There is an error while updating the Event Type from the system. Please try again or contact IT", MsgBoxStyle.Critical, "Unsuccessful")

        End If

    End Sub

    Private Sub btnUserType_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnUserType.Click
        Dim StrSQL As String, StrMess As String = String.Empty, Dtype As Integer, selectedRow As DataRow = grdEventTypes.SelectedItem
        If selectedRow Is Nothing Then
            MsgBox("Select the Event first.")
            Exit Sub
        End If
        If MsgBox("Is this event type specific to a particular user type? (Sales/Casework)", vbYesNo, "Add New") = 6 Then
            If MsgBox("Is this a casework event type?", vbYesNo, "Add New") = 6 Then
                Dtype = 2
                StrMess = "Set for Casework"
            Else
                Dtype = 1
                StrMess = "Set for Sales"
            End If

        Else
            Dtype = 3
            StrMess = "Set for all users"
        End If


        StrSQL = "Update L_EventTypes set EventType_Scope = " & Dtype
        StrSQL = StrSQL & " WHERE EventType_ID = " & selectedRow(0)

        If CommonDataFunctions.ExecuteSQL(StrSQL) = True Then
            StrMess = "Event Type no. " & selectedRow(0) & " (" & selectedRow(1) & ") edited, " & StrMess
            refreshList()
            MsgBox(StrMess)
        Else
            MsgBox("There is an error while updating the Event Type from the system. Please try again or contact IT", MsgBoxStyle.Critical, "Unsuccessful")
        End If
        Exit Sub

    End Sub

    Private Sub btnCustType_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnCustType.Click
       
        Dim StrSQL As String, StrMess As String = String.Empty, Dtype As Integer, selectedRow As DataRow = grdEventTypes.SelectedItem
        If selectedRow Is Nothing Then
            MsgBox("Select the Event first.")
            Exit Sub
        End If
        If MsgBox("Is this event type only applicable to a particular customer type? (Corporate/Private)", vbYesNo, "Add to Group") = 6 Then
            If MsgBox("Is this a corporate event type?", vbYesNo, "Add to Group") = 6 Then
                Dtype = 2
                StrMess = StrMess & "Set to corporate clients only"
            Else
                Dtype = 1
                StrMess = StrMess & "Set to private clients only"
            End If
        Else
            Dtype = 0
            StrMess = StrMess & "Set for all clients"
        End If

        StrSQL = "Update L_EventTypes set EventType_customerType = " & Dtype
        StrSQL = StrSQL & " WHERE EventType_ID = " & selectedRow(0)

        If CommonDataFunctions.ExecuteSQL(StrSQL) = True Then
            StrMess = "Event Type no. " & selectedRow(0) & " (" & selectedRow(1) & ") edited, " & StrMess
            refreshList()
            MsgBox(StrMess)
        Else
            MsgBox("There is an error while updating the Event Type from the system. Please try again or contact IT", MsgBoxStyle.Critical, "Unsuccessful")
        End If
        Exit Sub
    End Sub

    Private Sub btnAddToGroup_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnAddToGroup.Click

        Dim StrSQL As String, Result As DataTable, ETID As Long, EGID As Long, StrMess As String, NewOrder As Integer
        'Dim  ELID As Long
        Dim selectedEventGroupRow As DataRow = grdEventGroups.SelectedItem
        If selectedEventGroupRow Is Nothing Then
            Call MsgBox("Please select an Event Group First", , "Error")
            Exit Sub
        End If
        If selectedEventGroupRow Is Nothing Then Exit Sub
        Dim selectedEventRow As DataRow = grdEventTypes.SelectedItem
        If selectedEventRow Is Nothing Then
            Call MsgBox("Please select an Event Type to add to this group", , "Error")
            Exit Sub
        End If

        ETID = selectedEventRow(0)
        EGID = selectedEventGroupRow(0)

        StrSQL = "Select EventLink_Id, EventLink_CustomerType from I_EventLinks "
        StrSQL = StrSQL & " WHERE EventLink_EventGroupID = " & EGID
        StrSQL = StrSQL & " AND EventLink_EventTypeID = " & ETID

        Result = CommonDataFunctions.GetSQLDatatable(StrSQL)

        If Result.Rows.Count > 0 Then
            Result.Dispose()
            Call MsgBox("That Event Type is already in this event group", , "Action Cancelled")
            Exit Sub
        End If

        StrSQL = "Select isnull(MAX(EventLink_Order),0) as MaxOrder "
        StrSQL = StrSQL & " From I_EventLinks"
        StrSQL = StrSQL & " WHERE EventLink_EventGroupID = " & EGID
        Result = CommonDataFunctions.GetSQLDatatable(StrSQL)

        If Result.Rows.Count = 0 Then
            NewOrder = 1
        Else
            NewOrder = Result.Rows(0)("maxorder") + 1
        End If
        Result.Dispose()

        StrSQL = "Insert into I_EventLinks (EventLink_EventTypeID, EventLink_EventGroupID, EventLink_Order)"
        StrSQL = StrSQL & " VALUES(" & ETID & "," & EGID & "," & NewOrder & ")"

        If CommonDataFunctions.ExecuteSQL(StrSQL) = False Then Exit Sub

        StrMess = "Event Type no. " & ETID & " (" & selectedEventRow(1) & ") added to group " & EGID & " (" & selectedEventGroupRow(1) & ")"
        

        StrSQL = "Select EventLink_Id, EventLink_CustomerType from I_EventLinks "
        StrSQL = StrSQL & " WHERE EventLink_EventGroupID = " & EGID
        StrSQL = StrSQL & " AND EventLink_EventTypeID = " & ETID

        Result = CommonDataFunctions.GetSQLDatatable(StrSQL)

        If Result.Rows.Count = 0 Then
            'Error
            Result.Dispose()
            Call MsgBox("New link not found!", , "Error")
            Exit Sub
        End If
        FillEventTypesOfGroup(selectedEventGroupRow(0))
        Exit Sub
    End Sub

    Private Sub btnRemoveFromGroup_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnRemoveFromGroup.Click
        Dim StrSQL As String, Result As DataTable, StrMess As String, ELID As Long, Order As Integer
        Dim selectedEventInGroupRow As DataRow = grdEventsInGroup.SelectedItem, selectedGroupRow As DataRow = grdEventGroups.SelectedItem
        If selectedGroupRow Is Nothing Then
            MsgBox("Select the Group in order to remove the events from it.")
        End If
        If selectedEventInGroupRow Is Nothing Then
            MsgBox("Select the event to be removed first.")
            Exit Sub
        End If
        ELID = selectedEventInGroupRow(0)

        StrSQL = "Select EventLink_EventTypeID, EventLink_Order from I_EventLinks where EventLink_ID = " & ELID
        Result = CommonDataFunctions.GetSQLDatatable(StrSQL)

        If Result.Rows.Count = 0 Then
            'Error
            Result.Dispose()
            Call MsgBox("Event Link not found!", , "Error")
        End If

        StrMess = "Event Type no. " & Result.Rows(0)("EventLink_EventTypeID") & " (" & selectedEventInGroupRow(1) & ") removed from Event Group no. " & selectedGroupRow(0) & "(" & selectedGroupRow(1) & ")"
        Order = Result.Rows(0)("EventLink_Order")
        Result.Dispose()

        StrSQL = "Update I_EventLinks set EventLink_Order = EventLink_Order -1"
        StrSQL = StrSQL & " WHERE EventLink_Order > " & Order
        StrSQL = StrSQL & " AND EventLink_EventGroupID = " & selectedGroupRow(0)

        If CommonDataFunctions.ExecuteSQL(StrSQL) = False Then Exit Sub

        StrSQL = "Delete from I_EventLinks where EventLink_ID = " & ELID
        If CommonDataFunctions.ExecuteSQL(StrSQL) = True Then
            FillEventTypesOfGroup(selectedGroupRow(0))
            MsgBox(StrMess)
        Else
            MsgBox("There is an error while Removing Event from the Group. Please try again or contact IT", MsgBoxStyle.Critical, "Unsuccessful")
            Exit Sub
        End If

    End Sub

    Private Sub btnStages_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnStages.Click

        'Dim StrSQL As String, Resultst As DataTable, StrMess As String, IntStart As Integer, IntEnd As Integer

        'Dim selectedEventInGroupsRow As DataRow = grdEventsInGroup.SelectedItem
        'If selectedEventInGroupsRow Is Nothing Then
        '    Exit Sub
        'End If

        'If Me.Frm_StageStart = 3 And IsNull(Me.Combo_StageStart) Then
        '    Call MsgBox("Please chose a start stage from list, or select a different option", , "Error")
        '    Me.Combo_StageStart.SetFocus()
        '    Exit Sub
        'End If

        'Select Case Me.Frm_StageStart

        '    Case 1
        '        IntStart = 0
        '        StrMess = "Start stage set to 'New Case'"

        '    Case 2
        '        IntStart = 100
        '        StrMess = "Start stage set to 'Case Initiated'"

        '    Case Else
        '        IntStart = Me.Combo_StageStart
        '        StrMess = "Start stage set to '" & Me.Combo_StageStart.Column(1) & "'"

        'End Select

        'If Me.Frm_StageEnd = 4 And IsNull(Me.Combo_StageEnd) Then
        '    Call MsgBox("Please chose an end stage from list, or select a different option", , "Error")
        '    Me.Combo_StageEnd.SetFocus()
        '    Exit Sub
        'End If

        'Select Case Me.Frm_StageEnd

        '    Case 1
        '        IntEnd = 99
        '        StrMess = StrMess & vbCrLf & "End stage set to 'Case Initiated'"

        '    Case 2
        '        IntEnd = 999
        '        StrMess = StrMess & vbCrLf & "End stage set to 'Case Closed'"

        '    Case 3
        '        IntEnd = 0
        '        StrMess = StrMess & vbCrLf & "End stage set to 'After Case Closed'"


        '    Case Else
        '        IntEnd = Me.Combo_StageEnd
        '        StrMess = StrMess & vbCrLf & "End stage set to '" & Me.Combo_StageEnd.Column(1) & "'"

        'End Select

        'StrMess = "Event Type " & Me.List_EventLinks.Column(1) & " in group " & Me.List_EventGroups.Column(1) & " stages available set as follows. " & vbCrLf & vbCrLf & StrMess

        'StrSQL = "Update I_EventLinks Set "
        'StrSQL = StrSQL & " EventLink_StageStart = " & IntStart
        'StrSQL = StrSQL & " , EventLink_StageEnd = " & IntEnd
        'StrSQL = StrSQL & " Where EventLink_ID = " & Me.List_EventLinks

        'If GSI(StrSQL) = 0 Then Exit Sub

        'Me.List_EventLinks.Requery()

        'Call GblFunc_Add_SysEvent("Admin (Event Types)", StrMess)

        '' Error handling block added by VBA Code Commenter and Error Handler Add-In. DO NOT EDIT this block of code.
        'Exit Sub


    End Sub
End Class
